﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<KnitwearCompany.Models.Cart>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Корзина
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Корзина</h2>
        <table width='900px'>
        <tr>
            <th>
                Название
            </th>
            <th>
                Описание
            </th>
            <th>
                Цена
            </th>
             <th>
                Количество
            </th>
             <th>
                Сумма
            </th>            
            <th></th>
        </tr>
    <% foreach (var item in (List<KnitwearCompany.Models.PurchaseItem>)Model.Purchases) { %>
        <tr>
            <td>
                <%= Html.Encode(item.Product.Name) %>
            </td>
            <td>
                <%= Html.Encode(item.Product.Description)%>
            </td>
            <td>
                <%= Html.Encode(item.Product.Price)%>
            </td>
            <td>
                <%= Html.Encode(item.Amount)%>
            </td>
            <td>
                <%= Html.Encode(item.GetSum())%>
            </td>
            <td>
                <%= Html.ActionLink("Подробнее", "ViewProduct", new { ID = item.Product.Id }) %> | 
                <%= Html.ActionLink("Удалить", "RemovePurchaseItem", new { ID = item.Product.Id }) %>
            </td>
        </tr>
    <% } %>
    </table>
    <h2>Итого: <%= Model.GetSum() %></h2>
    <center><h3><%: Html.ActionLink("Оформить заказ", "CreateOrder", "Home")%></h3></center>
</asp:Content>
